import request from '@/utils/request'

// 请示报告 VO
export interface ApprovalrequestreportVO {
  id: number // 主键
  userId: number // 发起人id
  userName: string // 发起人
  deptId: number // 部门id
  deptName: string // 部门
  serialNumber: string // 台账序号
  initiationDate: string|number // 发起日期
  summary: string // 事由简述
  url: string // 附件
  remark: string // 备注
  processInstanceId: string // 流程编号
  startUserSelectAssignees:any // 指定审批人
  status: any // 流程状态
  isApproved:any; // 是否审批
  [key: string]: any;
}

// 请示报告 API
export const ApprovalrequestreportApi = {
  // 查询请示报告分页
  getApprovalrequestreportPage: async (params: any) => {
    return await request.get({ url: `/bpm/request-report/page`, params })
  },

  // 查询请示报告详情
  getApprovalrequestreport: async (id: number) => {
    return await request.get({ url: `/bpm/request-report/get?id=` + id })
  },

  // 新增请示报告
  createApprovalrequestreport: async (data: ApprovalrequestreportVO) => {
    return await request.post({ url: `/bpm/request-report/create`, data })
  },

  // 修改请示报告
  updateApprovalrequestreport: async (data: ApprovalrequestreportVO) => {
    return await request.put({ url: `/bpm/request-report/update`, data })
  },

  // 删除请示报告
  deleteApprovalrequestreport: async (id: number) => {
    return await request.delete({ url: `/bpm/request-report/delete?id=` + id })
  },

  // 导出请示报告 Excel
  exportApprovalrequestreport: async (params:any) => {
    return await request.download({ url: `/bpm/request-report/export-excel`, params })
  },

}
